<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>{{ $app_name }} - @yield('当前页面')</title>
    <link rel="stylesheet" href="{{asset('asset/layui/css/layui.css')}}">
    <link rel="stylesheet" href="{{asset('asset/style/admin.css')}}" media="all">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_1554481_dxbii50bry7.css" media="all">


    <script src="{{asset('asset/layui/layui.js')}}"></script>
    <script src="{{asset('js/common.js')}}"></script>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script>
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            layerIndex:-1,
            complete: function () {
                layer.close(this.layerIndex);
            },
            error: function () {
                layer.alert('服务器内部错误,请联系开发人员!', {
                    skin: 'layui-layer-molv',
                    closeBtn: 0
                    , shift: 4 //动画类型
                });
            }
        });

        // 处理csrf
        layui.use(['table','form'],function(){
            var $ = layui.$;

            //筛选重载表格
            var table = layui.table;
            var form = layui.form;
            form.on('submit(search)', function(data){
                var field = data.field;
                //执行重载
                table.reload('model', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    },
                    where: field
                });
            });
        })

    </script>

    {{--引入文件--}}
    @section('import')
    @show

    {{--css样式--}}
    @section('css')
    @show
</head>
<body class="layui-layout-body">

{{--页面主体内容--}}
@section('content')
@show

@section('js')
@show
</body>
</html>
